package com.alipay.config;

import java.io.FileWriter;
import java.io.IOException;

/* *
 *类名：AlipayConfig
 *功能：基础配置类
 *详细：设置帐户有关信息及返回路径
 *修改日期：2017-04-05
 *说明：
 *以下代码只是为了方便商户测试而提供的样例代码，商户可以根据自己网站的需要，按照技术文档编写,并非一定要使用该代码。
 *该代码仅供学习和研究支付宝接口使用，只是提供一个参考。
 */

public class AlipayConfig {
	
//↓↓↓↓↓↓↓↓↓↓请在这里配置您的基本信息↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓

	// 应用ID,您的APPID，收款账号既是您的APPID对应支付宝账号
	public static String app_id = "2016091200497707";
	
	// 商户私钥，您的PKCS8格式RSA2私钥
    public static String merchant_private_key = "MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQC4S+VdJpzZGbrHlFAXED2jhUJhA8X2oDKu6F88d6noJGGbyYJCgyJB/iB9GuVcBPJc3wIiosGlzCOMRd2KLIcULp52HVVVIemPZRtyh3U/1pY7avZeIcCZWuxeZEHb6IAUMd/Vso+yDWnFcbaye+kfTC9GCxT4mis+TT+2L6VUTpWPneYp/SmWFmuh0BaqsNM2Wgm4feWLCdonkov/E29vlFUm6+cMeEj5CpuCZX0NvpyrTer/In/SHv2QfcSCquGW+2kg/UZC2woR4fMm/sTw6slSk/xcAM19eOfKXc7n0jm3zOM2tfwprC0VWeJZfesJcnwbA7YYeYaR9HKvmS85AgMBAAECggEAJy5Tg/tKi0lSEU4xvMWCJTqWgyOXObiTLeZPIP7by3O4oLM1k0hnxxns9Ev8iRSwJhhvTsfFXadJw2+zCsYurZa/r6LK2n+MNSUssaukvL61T8qMuDR6yt+ust6jtcn3ONPln3wH2rXJT+W+DrITPMkon76JZdT47pTjv6rffk2dPrJ4jaI684oTjiV61eggPhUkDGJfcHvGP3XODkAx3TpyW6ZWRoN8YxBRIUIll30ZFu7ui+TqgfYMItxKhdnpLpi3hu21I74ESV+99jpSPWkjCCX9hU9hld3IYCVOeFbtPGWuDEVq8GbM/j3D9iyGWhrzFQM5uldKKdpjwj8CEQKBgQD9dBvHn+bZ+jaARpoBmDc216wp1Tnrp4SO6lDzrZ0y7ZKs8jrVtgP+TAbHoi/nCyP801n7Z0MC38MJeAi/wlpEIhANmXl8nenej/hqW9tJGXArn1pjN3E/YOIl9MUjy7mRwTkN1QSKsdHKIWbR8RAb9U8vyL6jA8iAU6vhRYtnrQKBgQC6Jem5Qw8Bgbp9kdXg1Cu0LaIFalv0/FI4WMwfb92auFmZ1fsrhdzW7h5DhZqR/jfpGUVShSj+X3hWyDYnwBrVtR5lsk1+B0sXDOiJN3bkOjGSmOB0kuDAC/Q4LinFqoo2iWcfTLhiddGBO19MrLJL0vq5xhwpRApBg5jZgDLHPQKBgHSdmbKN5h/hOnZnBbE6Ih1/ul09GHtPBnTjZv/Xn/6wxM4CXgO6zbeRr4TnIPdDbvmDHWHJL1IBNrICorPobrPuoEhBl145IkQfJgN55DmMFMpdda808Uxh/WvNZW+E6wsfRmsQ2hgenRJNsAtkyS6z/g1UZjKHKReyZ+EsqGm5AoGAA+5ZCTiJUJbUwWIbCixw39U23rZoSrwpYFc/uEo8e8/41G7YZwrkpwVQTky7/ulHdPy7ogp92yFZATwpKJ2981Vn1u31BPxScaIsJvms4RT5hwcDdnLDnEqkVatj5nC7intMWjTcj/e8/OWsFYpwGXnTIak1Xwm4zblhuPYkHGECgYBlvQlpBKBQrOaFcdN26KWYW+S55CjOYdssk9a77ktLrIvVi7iLgJ6RBtakCdo+a2ZhI/AG9sVi+qdg+wYakGFPeI+g1zArilQeQQRXmyNArx4a9cnyrTwhsoexnkEU1OgDBOp0Aq1aB1fTglyB/LEnhIuUC64Dp49XLxMuNQlUNA==";
	
	// 支付宝公钥,查看地址：https://openhome.alipay.com/platform/keyManage.htm 对应APPID下的支付宝公钥。
    public static String alipay_public_key = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA2ofp11AQCX1FkooCpmWzYEdTBcO3eKQkiA6qhywjcrfg5P9R6OpQTmGrBidmuy36Ty547hf3ulxmhWSbB/fDOq2AmO6YECxJiH756LB4lvTWOhGDp8O9PXHRSsUQid9dS+EzgNuqMZv+c/ykh48N6H/2blYTOhAC38lu2hRl2MjvMu2vJYnNPcdADlwNIDyVx/uouFx6z5CHWb1UiIe2qE1Lx0+nwirS+gIgNiXpAJ+BHeT04LpTVz6iv+H4+NTDc5cKwQDBz9Ynyb/VvC16jXNR/1ytCXlddlAJVl9O9K3bzH8lnsIIvwj5YvyqXapWiPT2MFR+4Vgp8+zG8WZ6xQIDAQAB";

	// 服务器异步通知页面路径  需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
	public static String notify_url = "http://localhost:8080/stage/LLpersonal.html";

	// 页面跳转同步通知页面路径 需http://格式的完整路径，不能加?id=123这类自定义参数，22必须外网可以正常访问
	public static String return_url = "http://localhost:8080/stage/LLpersonal.html";

	// 签名方式
	public static String sign_type = "RSA2";
	
	// 字符编码格式
	public static String charset = "utf-8";
	
	// 支付宝网关
	public static String gatewayUrl = "https://openapi.alipaydev.com/gateway.do";
	
	// 支付宝网关
	public static String log_path = "C:\\";


//↑↑↑↑↑↑↑↑↑↑请在这里配置您的基本信息↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    /** 
     * 写日志，方便测试（看网站需求，也可以改成把记录存入数据库）
     * @param sWord 要写入日志里的文本内容
     */
    public static void logResult(String sWord) {
        FileWriter writer = null;
        try {
            writer = new FileWriter(log_path + "alipay_log_" + System.currentTimeMillis()+".txt");
            writer.write(sWord);
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (writer != null) {
                try {
                    writer.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}

